<ion-view view-title="订单">
	<ion-content padding="true">
		<ion-refresher on-refresh="doRefresh()">
		</ion-refresher>
      	<ion-list>
      		<ion-item >订单号：{{item.order_id}}</ion-item>
      		<ion-item >服务项目：{{item.serviceType}}</ion-item>
      		<ion-item >联系人：{{item.name}}</ion-item>
      		<ion-item >联系电话：<a href="tel:{{item.phone}}">{{item.phone}}</a></ion-item>
            <ion-item style="overflow:auto;white-space:normal">联系地址：{{item.address}}</ion-item>
      		<ion-item style="overflow:auto;white-space:normal">订单详情：{{item.detail}}</ion-item>
      		<ion-item >价格：{{item.settlement_price}} 元 {{item.settlement_unit}}</ion-item>
      		<ion-item >
                数量：

                <span ng-if="settlement_status==1"
                        style="min-height:30px;min-width:30px;line-height:30px">{{item.settlement_service_times}}</span>
                <span class="button "
                      ng-if="settlement_status!=1 && state=='scan'"
                                ng-click="updateServiceTimes( item, '+')"
                                style="min-height:30px;min-width:30px;line-height:30px" >+</span>
                <span class="button "
                      ng-if="settlement_status!=1"
                      style="min-height:30px;min-width:30px;line-height:30px">{{item.settlement_service_times}}</span>
                <span class="button "
                      ng-if="settlement_status!=1  && state=='scan'"
                  ng-click="updateServiceTimes( item, '-' )"
                  style="min-height:30px;min-width:30px;line-height:30px">-</span>

            </ion-item>
            <style>
                .add,.reduce{ display:inline-block; border:solid 1px #666;   padding:5px 12px; background-color:#fff; border-radius: 5px;}
                .extra-add .add{ background-color:#cdcdcd }
                .extra-reduce .reduce{ background-color:#cdcdcd }
            </style>
      		<ion-item >
                额外价格：
                <span ng-show="extra_price_edit_status==0">
                    {{item.settlement_extraPrice}}
                </span>
                <span ng-show="extra_price_edit_status==1">
                    <span class="extra-{{item.extraPriceFlag}}" >
                                    <span ng-click="changeExtraPrice('add')" class="add" >+</span>
                                    <span ng-click="changeExtraPrice('reduce')" class="reduce" >-</span>
                                </span>
                    <div style="height:10px; margin: 0; padding:0; "></div>
                                <span class="" ng-show="item.extraPriceFlag=='add'">
                                    加价:<input   type="number" min="0"
                                                style="border: solid 1px #cdcdcd; display: inline;"
                                                ng-change="getPriceTotal( item )"
                                                ng-model="item.settlement_extraPrice_add" >
                                </span>

                                <span class="" ng-show="item.extraPriceFlag=='reduce'">
                                    折扣:<input  type="number" min="0"
                                               style="border: solid 1px #cdcdcd; display: inline;"
                                               ng-change="getPriceTotal( item )"
                                               ng-model="item.settlement_extraPrice_reduce" >
                                </span>
<!--                    <input type="text"
                           style="border: solid 1px #cdcdcd; display: inline;"
                           ng-model="item.settlement_extraPrice" />-->
                </span>
                <div style="height:10px; margin: 0; padding:0; "></div>
                <span class="button "
                      ng-if="settlement_status!=1  && state=='scan'"
                      ng-show="extra_price_edit_status==1"
                      ng-click="checkExtraPrice( item )"
                      style="min-height:30px;min-width:30px;line-height:30px">确定额外价格</span>
                <span class="button "
                      ng-if="settlement_status!=1  && state=='scan'"
                      ng-show="extra_price_edit_status==0"
                      ng-click="setExtraPrice( )"
                      style="min-height:30px;min-width:30px;line-height:30px">修改额外价格</span>
            </ion-item>

            <ion-item ng-if="settlement_status==1">已结算</ion-item>
            <ion-item ng-if="settlement_status!=1">未结算</ion-item>
            <ion-item ng-if="settlement_status==1">卡支付金额：{{item.settlement_card_fund}} </ion-item>
            <ion-item ng-if="settlement_status==1">现金支付金额：{{item.settlement_cash}} </ion-item>

      		<ion-item ng-if="state=='scan' && settlement_status!=1">
                卡内金额：{{card.fund}}元。还需要支付现金：{{item.settlement_cash}}元
            </ion-item>
            <ion-item >总价：{{item.settlement_total}}</ion-item>
      		<ion-item >预约时间：{{item.time}}</ion-item>
      		<ion-item >下单时间：{{item.create_time}}</ion-item>
      	</ion-list>
        <div ng-if="state=='scan'">
            <button
                    id="finish-btn"
                    ng-if="item.status == '已接单' || item.status == '试工中' || item.status == '服务中'"
                    ng-show="item.finish_button == 'not_click'"
                    class="button button-balanced button-block" ng-click="update(item)">
                完成
            </button>
            <button
                    ng-if="item.status == '已接单' || item.status == '试工中' || item.status == '服务中'"
                    ng-show="item.finish_button == 'clicked'"
                    class="button button-balanced button-block" >
                正在支付
            </button>
        </div>

    </ion-content>
</ion-view>